#SRCS := $(shell find -name "*.asm")
SRCS := c07_mbr2.asm
OUTPUT := test

all: $(OUTPUT).bin

$(OUTPUT).bin: $(SRCS)
	nasm -f bin $(SRCS) -o $(OUTPUT).bin -l $(OUTPUT).lst

clean:
	rm -rf *.bin *.lst *.img

qemu:
	qemu-system-i386 -drive file=$(OUTPUT).bin

qemu-gdb:
	qemu-system-i386 -drive file=$(OUTPUT).bin -S -s

gdb:
	gdb --tui \
        -ex 'target remote localhost:1234' \
        -ex 'set tdesc filename target.xml' \
        -ex 'layout asm' \
        -ex 'layout regs' \
        -ex 'break *0x7c00' \
		-ex 'set disassembly-flavor intel ' \
        -ex 'continue'
